import request from "@/utils/request";

// 获取时间戳
export function getTimeStamp() {
  return request({
    url: "/api/login/generate/time",
    method: "post",
  });
}

// 登录方法
export function login(username, password, code, uuid) {
  return request({
    url: "/auth/login",
    headers: {
      isToken: false,
    },
    method: "post",
    data: { username, password, code, uuid },
  });
}

// 获取时间戳
// export function getInfo(token) {
//   return request({
//     url: "/api/login/getUserInfo",
//     method: "post",
//     data: { token },
//   });
// }
// 获取用户详细信息
export function getInfo() {
  return request({
    url: "/system/user/getInfo",
    method: "get",
  });
}
// 获取验证码
export function getCodeImg() {
  return request({
    url: "/code",
    headers: {
      isToken: false,
    },
    method: "get",
    timeout: 20000,
  });
}

// 获取title
export function getConfigKey(configKey) {
  return request({
    url: "/system/config/configKey/" + configKey,
    method: "get",
    headers: {
      isToken: false,
    },
  });
}

// 获取key
export function getPublicKey() {
  return request({
    url: '/auth/publicKey',
    method: 'get',
  })
}
